package com.okilo.online.app.dialog

import android.content.Context
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.WindowManager
import com.okilo.online.app.R
import com.okilo.online.app.common.OkiloComDlog
import com.okilo.online.app.databinding.OkiloDlogSubSuccessBinding

/**
 * OkiloLoan
 * @Author wwdeng
 * @CreateTime: 2024/11/11 15:41
 * @Annotation：提交成功提示dialog（OCR、Selfie、手机号校验）
 */
class OkiloSubSuccessDlog: OkiloComDlog {
    private lateinit var binding: OkiloDlogSubSuccessBinding

    override fun initializeOkiloWindow() {
        val params = window?.attributes
        params?.width = WindowManager.LayoutParams.WRAP_CONTENT
        params?.height = WindowManager.LayoutParams.WRAP_CONTENT
        window?.attributes = params
        window?.setWindowAnimations(R.style.dialog_scale_anim) //修改动画样式
        window?.setGravity(Gravity.CENTER)
    }

    constructor(context: Context) : super(context) {}

    constructor(context: Context, remark: String) : super(context) {
        dialogRemark = remark
    }

    override val dialogName: String = "Submit_Success"

    override fun createOkiloContentView(): View {
        binding = OkiloDlogSubSuccessBinding.inflate(LayoutInflater.from(context))
        return binding.root
    }

    override fun initializeOkiloViews() {
    }

    override fun setupOkiloEventListeners() {
    }

    override fun loadOkiloData() {
    }

    override fun onOkiloEventViewClick(v: View?) {
        dismiss()
    }

    /**
     * 设置埋点备注
     */
    fun setTipsEventRemark(remark: String){
        dialogRemark = remark
    }

    /**
     * 设置提示文案
     */
    fun setTipsSuccessText(tips: String){
        binding.okiloSubSuccessTipsText.text = tips
    }

    interface IDialogCallback {
        //按钮点击
        fun onClick(view: View?)
    }
}